<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:fb="http://www.facebook.com/2008/fbml">
>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Together</title>
</head>
<body>
	<%@include file="header.jsp"%>
	<!--  http://greenchiou.blogspot.com/2010/12/javascript-facebook-sdk-width-graphic.html -->
	<div class="container">
		<div id="fb-root"></div>
		<script>
			window.fbAsyncInit = function() {
				FB.init({
					appId : '119388268186376', // App ID
					status : true, // check login status
					cookie : true, // enable cookies to allow the server to access the session
					xfbml : true
				// parse XFBML
				});

				// Additional initialization code here
			};

			// Load the SDK Asynchronously
			(function(d) {
				var js, id = 'facebook-jssdk', ref = d
						.getElementsByTagName('script')[0];
				if (d.getElementById(id)) {
					return;
				}
				js = d.createElement('script');
				js.id = id;
				js.async = true;
				js.src = "//connect.facebook.net/en_US/all.js";
				ref.parentNode.insertBefore(js, ref);
			}(document));
			
			function login(){
			
			FB.login(function(response) {
					if (response.authResponse) {
						FB.api('/me', function(response) {
							alert('logined');
						});
					} else {
						alert('login failed')
					}
				}, {
					scope : 'email'
				});
			}
		</script>
		<button onclick="login()">Login facebook</button>
	</div>

</body>
</html>